<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
		<div id="page_nav">
		
			<c:if test="${requestScope.page.pageNo>1 }">
				<a href="${requestScope.page.url}&pageNo=1">首页</a>
				<a href="${requestScope.page.url}&pageNo=${requestScope.page.pageNo-1 }">上一页</a>
			</c:if>
			
			<c:choose>
			    <%-- 第一种情况：页码小于5的时候 --%>
				<c:when test="${requestScope.page.pageTotal <= 5 }">
					<c:set value="1" var="begin"/>
					<c:set value="${requestScope.page.pageTotal }" var="end"/>
				</c:when>
				
				<%-- 第二种情况：页码大于5时--%>
				<c:otherwise>
					<c:choose>
						<c:when test="${requestScope.page.pageNo <= 3 }">
							<c:set value="1" var="begin"/>
							<c:set value="5" var="end"/>
						</c:when>
						<c:when test="${requestScope.page.pageNo >= requestScope.page.pageTotal-2 }">
							<c:set value="${requestScope.page.pageTotal-4}" var="begin"/>
							<c:set value="${requestScope.page.pageTotal }" var="end"/>
						</c:when>
						<c:otherwise>
							<c:set value="${requestScope.page.pageNo-2}" var="begin"/>
							<c:set value="${requestScope.page.pageNo+2 }" var="end"/>
						</c:otherwise>
					</c:choose>
				</c:otherwise>
			</c:choose>
			
			<c:forEach begin="${begin}" end="${end}" var="i">
				<c:if test="${i == requestScope.page.pageNo }">【${i}】</c:if>
				<c:if test="${i != requestScope.page.pageNo }">
					<a href="${requestScope.page.url}&pageNo=${i}">${i}</a>
				</c:if>
			</c:forEach>
			
			<c:if test="${requestScope.page.pageNo < requestScope.page.pageTotal }">
				<a href="${requestScope.page.url}&pageNo=${requestScope.page.pageNo+1 }">下一页</a>
				<a href="${requestScope.page.url}&pageNo=${requestScope.page.pageTotal }">末页</a>
			</c:if>
			
			共${requestScope.page.pageTotal}页，${requestScope.page.pageTotalCount }条记录  到第<input value="${requestScope.page.pageNo }" name="pn" id="pn_input"/>页
			<input type="button" id="searchPageNo" value="确定">
		</div>
		<script type="text/javascript">
			$(function(){
				$("#searchPageNo").click(function(){
					var pageNo = $("#pn_input").val();
					
					location.href = "${path}${requestScope.page.url}&pageNo=" + pageNo;
				});
			});
		</script>